# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        博智科技  
# Name:         demo1117
# Description:
# Author:       yzl
# Date:         2019-02-07
#-------------------------------------------------------------------------------

import re

# 分组
# 以银行卡号为例
# 发卡行 前4位标识号
# 建行 6227
# 邮政 6210
# 民生 6226

m = re.match('(\d{3})-(\d{2})-([a-z|A-Z|0-9]{2})','123-45-1b')
if m is not None:
    print(m.group())
    print(m.group(1))
    print(m.group(2))
    print(m.group(3))
    print(m.groups())
    mg = m.groups()
    for item in mg:
        print(item)

